<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/3/6 0006
 * Time: 22:25
 */
class My extends Thread {
    public function run() {
        sleep(10);
        echo("HELLO 1 \r\n");
    }
}

class My2 extends Thread {
    public function run() {
        /* ... */
        sleep(3);
        echo("HELLO 2 \r\n");
    }
}



class My3 extends Thread {
    public function run() {
        /* ... */
        sleep(1);
        echo("HELLO 3 \r\n");
    }
}


class My4 extends Thread {
    public function run() {
        /* ... */
        sleep(5);
        echo("HELLO 4 \r\n");
    }
}


$my_1 = new My();
$my_2 = new My2();
$my_3 = new My3();
$my_4 = new My4();

$my_1->start();
$my_2->start();
$my_3->start();
$my_4->start();

$my_1->join();
$my_2->join();
$my_3->join();
$my_4->join();
echo("main ");